<?php

class ClassStructure_PointCut {
    
    private $str_pattern = null;
    
    /**
     * Class constructer: encapsulates the supplied object and prepares this class
     * with information about the available method signatures.
     *
     * @access public
     * @param object $obj The object to encapsulate and become a base layer.
     * @return object
     */
    public function __construct($str_method = null) {
        $this->setMethod($str_method);
    }
    
    public function setMethod($str_method) {
        if(is_string($str_method)) {
            $str_pattern = '/^' . $str_method . '$/';
            $this->setPattern($str_pattern);
        }
    }
    
    public function setPattern($str_pattern) {
        if(is_string($str_pattern)) {
            $this->str_pattern = $str_pattern;
        }
    }
    
    public function getPattern() {
        return $this->str_pattern;
    }
    
    public function matchesMethod($str_method) {
        return preg_match($this->str_pattern, $str_method);
    }
    
}

?>
